/**
 * @file   main.cpp
 * @author Linfufu
 * @date   Wed Nov 24 17:06:36 2021
 * 
 * @brief  
 * 
 * 
 */
#include<bits/stdc++.h>
#include "BalanceTree.h"
using namespace std;
static const int N=99999;
int main( )
{
  clock_t startTime,endTime;
  
  AvlTree<int> test1;//测试avltree
  startTime = clock();
  for( int i=0; i<N; i++ )
    {
      int temp1 = rand()%INT_MAX;
      test1.insert(temp1);
    }
  endTime = clock();
  cout<<"AVLTree: insert"<<N<<"numbers cost"<<endTime-startTime<<"ms"<<endl;

  SplayTree<int>  test2;
  Tree T;
  T = test2.InitializeSplayTree();
  T = test2.MakeSplayTreeEmpty(T);
  startTime = clock();
  for(int i=0; i<N; i++)
     {
       int temp2 = rand()%INT_MAX;
       T=test2.insert(temp2,T);
     }
  endTime = clock();
  cout<<"SplayTree: insert"<<N<<"numbers cost"<<endTime-startTime<<"ms"<<endl;
  return 0;
};
